package string;

/**
 * boolean startsWith(String str)
 * 判断当前字符串是否以给定字符串开始的
 *
 * boolean endsWith(String str)
 * 判断当前字符串是否以给定字符串结束的
 */
public class StartsWithDemo {
    public static void main(String[] args) {
        String line = "www.tedu.cn";
        boolean starts = line.startsWith("www");
        System.out.println(starts);
        starts = line.startsWith("WWW");
        System.out.println(starts);

        boolean ends = line.endsWith(".cn");
        System.out.println(ends);
        ends = line.endsWith(".com");
        System.out.println(ends);
    }
}












